package com.mapproject.industrymap.service.impl;

import com.alibaba.fastjson.JSON;
import com.mapproject.industrymap.entity.jsydgzq;
import com.mapproject.industrymap.mapper.jsydgzqMapper;
import com.mapproject.industrymap.service.ExampleCodeService;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Service
public class ExampleCodeServiceImpl implements ExampleCodeService {
    @Autowired
    jsydgzqMapper jsydgzqMapper;
    @Override
    public ReturnValue getdata(){
        List<jsydgzq> dataset=jsydgzqMapper.getdata();
        for(jsydgzq evedata:dataset){
            if(!StringUtils.isEmpty(evedata.getVirtualfield())){}
               evedata.setVirtualfield(JSON.parse(evedata.getVirtualfield().toString()));
        }
        return new ReturnValue(200,"", dataset);
    }
    public ReturnValue getdataone(){
        List<jsydgzq> dataset=jsydgzqMapper.getdataone();
        for(jsydgzq evedata:dataset){
            if(!StringUtils.isEmpty(evedata.getVirtualfield())){}
            evedata.setVirtualfield(JSON.parse(evedata.getVirtualfield().toString()));
        }
        return new ReturnValue(200,"", dataset);
    }
}
